const addCategoriesList = (arr: any, resData: any, cat_id: number) => {
  arr.forEach((item: any) => {
    if (item.cat_id === cat_id && item.children instanceof Array) {
      item.children.push(resData)
    }
    if (item.children && item.children.length > 0) {
      addCategoriesList(item.children, resData, cat_id)
    }
  })
}

export default addCategoriesList